<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcPointLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_point_log', function (Blueprint $table) {
            $table->increments('point_id');
            $table->unsignedInteger('customer_id')->comment('用户ID');
            $table->unsignedTinyInteger('source')->comment('积分来源：0订单，1登陆，2活动 3签到');
            $table->unsignedInteger('refer_number')->default('0')->comment('积分来源相关编号');
            $table->smallInteger('change_point')->default('0')->comment('变更积分数');
            $table->timestamp('create_time')->comment('积分日志生成时间');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_point_log');
    }
}
